# added by yinchao, Fri June 21 10:31	2024
# string testting

import string

print(string.ascii_letters)
print(string.ascii_lowercase)
print(string.ascii_uppercase)
print(string.digits)
print(string.punctuation)

# What's the difference between string module and <class str> in Python

mbox_filehandler = open('mbox.txt', 'r')

count = 0
for line in mbox_filehandler:  # python-for-everyone:82
    count += 1

print(count)

# mbox_filehandler.seek(0, 0)
mbox_filehandler.seek(0)
for line in mbox_filehandler:
    if line.startswith('From: '):
        # print(line.rstrip())
        pass

mbox_filehandler.seek(0)
individuals = set()
for line in mbox_filehandler:
    if not line.startswith('From: '):
        continue

    if line.find('@uct.ac.za') == -1:
        continue

    # print(line.rstrip())
    individuals.add(line.rstrip())

for individual in individuals:
    print(individual)
